Skip to main content
gamedev.net
🔒 Locked

C++ Unit Testing

Started by Solstice Jun 19, 2002 at 1:43 AM 2 replies 800+ views
Original Post
Solstice
Solstice
I saw too many internet headlines about "Why Today''s software is bad", and that it''s lack of testing. I need a simple to use unit testing system for C++. The catch? I''m on linux and would like a portable framework. -Solstice deninet.com aeris.deninet.com "...I was given three choices, the earth, the stars, or..."
-Solsticedeninet.comaeris.deninet.com"...I was given three choices, the earth, the stars, or..."
Fruny
Fruny
Boost Test Library ? (Unit testing isn't in yet )

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]


[edited by - Fruny on June 19, 2002 2:51:04 AM]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
gimp
gimp
Simple framework for unit testing?

Try just creating a static member function called void UnitTest() that contains tests for that class. Create a project that calls UnitTest() on all the classes. Throw on errors, collect the exception and alert on the command line as to what test fails.

I''ve never seen anything more complex than that, though I''m certain you could do something silly and hard like using self registration in to a testing framework, just to waste your time (Or if your dealing with a few thousand classes)

HTH
Chris

References to look up:
"Code Complete"
"Extreme Programming"



Chris Brodie
http:\\fourth.flipcode.com
Chris Brodie

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.